<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class UserUni extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_uni', function (Blueprint $table) {
            $table->bigInteger('user_id')->unsigned()->primary()->comment('用户 id');
            $table->string('mp_openid', 32)->default('')->comment('公众号openid');
            $table->string('dev_openid', 32)->default('')->comment('开放平台openid');
            $table->string('min_openid', 32)->default('')->comment('小程序openid');
            $table->string('wx_unionid', 32)->default('')->comment('只有在用户将公众号绑定到微信开放平台帐号后，才会出现该字段');
            $table->string('nickname', 20)->default('')->comment('昵称');
            $table->tinyInteger('sex')->default(0)->comment('性别');
            $table->string('province', 10)->default('')->comment('省份');
            $table->string('city', 10)->default('')->comment('城市');
            $table->string('country', 10)->default('')->comment('国家');
            $table->string('headimgurl',255)->default('')->comment('头像');
            $table->string('privilege', 20)->default('')->comment('用户特权信息');
            $table->string('qq_openid', 32)->default('')->comment('qqopenid');
            $table->string('qq_unionid', 32)->default('');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_uni');
    }
}
